home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6630 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: goanna.cs.rmit.EDU.AU!not-for-mail
  2. From: ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2
  4. Subject: Re: Hungarian notation - whoops!
  5. Date: 12 Feb 1996 18:45:44 +1100
  6. Organization: Comp Sci, RMIT, Melbourne, Australia
  7. Message-ID: <4fmr78$aov@goanna.cs.rmit.EDU.AU>
  8. References: <30C40F77.53B5@swsbbs.com> <Pine.HPP.3.91.960124153551.24374C-100000@zeezrom.cs.byu.edu> <4e7ifl$et3@goanna.cs.rmit.EDU.AU> <Pine.HPP.3.91.960129133429.8419C-100000@foggy.cs.byu.edu> <4em29qINN39r@keats.ugrad.cs.ubc.ca> <Pine.HPP.3.91.960201015336.17360C-100000@clear.cs.byu.edu> <4f41vf$g8j@goanna.cs.rmit.EDU.AU> <Pine.HPP.3.91.960205124102.18647E-100000@warm.cs.byu.edu> <4fc157$jsf@goanna.cs.rmit.EDU.AU> <1996Feb8.130010.27570@friend.kastle.com>
  9. NNTP-Posting-Host: goanna.cs.rmit.edu.au
  10. NNTP-Posting-User: ok
  11. X-Newsreader: NN version 6.5.0 #0 (NOV)
  12.  
  13. I pointed out that none of the machines I normally use supports 16-bit
  14. little-endian integers, and that some of the machines I could use or 
  15. used to use didn't, don't, or couldn't.
  16.  
  17. rich@kastle.com (Richard Krehbiel) writes:
  18. >Seriously?  I think you are giving up too early.  He did say "whatever
  19. >it takes".
  20.  
  21. >A 486SX can do IEEE floating point arithmetic, but it has no floating
  22. >point unit.  It does it with software emulation.  C compilers for 8
  23. >bit micros can somehow multiply and divide even though the CPU only
  24. >has add, subtract, and shift instructions.
  25.  
  26. >I suspect that, with a bit of software, even your machines could
  27. >implement 16 bit little endian integers.
  28.  
  29. Some of the machines I referred to DO NOT HAVE *ANY* 16-bit storage format.
  30. The 486SX example is not really relevant, because while the hardware may not
  31. have floating-point _instructions_, it has load and storage instructions that
  32. are compatible with the _storage format_.
  33.  
  34. The multiply and divide example is similarly beside the point.
  35. The SPARC architecture didn't have an integer multiply or divide instruction
  36. either (the V8 architecture manual lists them, but not all chips had all of
  37. the instructions at the time my copy of the manual was released).  But that
  38. doesn't matter: it DID have the requisite _storage formats_.  And you will
  39. note that supplying the operations is the responsibility of the compiler:
  40. if the compiler didn't compensate for the missing operations, there would
  41. be no *simple* change to the C source code that could do the job.
  42.  
  43. There are a lot of ways I could emulate 16-bit little endian integers on
  44. all of the machines I mentioned, but none of them are even remotely as
  45. simple as changing a C typedef, which is what the original poster claimed
  46. to be sufficient.  In fact, the easiest way to get such code running on
  47. the machine I'm using at the moment would be to run it under WABI.
  48.  
  49. -- 
  50. "conventional orthography is ... a near optimal system for the
  51.  lexical representation of English words." Chomsky & Halle, S.P.E.
  52. Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
  53.